﻿import { createCrudApi } from '@/utils/apiFactory';
import request from '@/utils/unirequest';
import type { IResult } from '@/type/common';
import type { ISysVisitorRecordRequestBill, ISysVisitorRecordRequestBillView, ISysVisitorRecordRequestBillVm } from './interface';

export default function SysvisitorrecordrequestbillApi() {
  // 基础CRUD用工厂生成
  const baseCrud = createCrudApi<
    ISysVisitorRecordRequestBillView,
    ISysVisitorRecordRequestBillVm,
    ISysVisitorRecordRequestBill
  >('/api/SysVisitorRecordRequestBill');

  return {
    ...baseCrud,

    // 额外的特殊接口
    async getBillCode(): Promise<IResult<string>> {
      return await request.get('/api/SysVisitorRecordRequestBill/PredictCode');
    },
  };
}